package com.say.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.say.bean.domain.Trace;


@Repository
public interface TraceDao extends JpaRepository<Trace, String> {
	
	@Query(nativeQuery = true, value = " SELECT * from trace t WHERE t.user_id in (SELECT to_user_id from friends f WHERE f.user_id=?1 ) ORDER BY t.create_time desc LIMIT 1 ")
	public Trace getTraceByFriendsUserId(String userId);
	
	
}
